import axios from 'axios';
import { Message } from 'element-ui'

axios.defaults.timeout = 5000;

//http request 拦截器
axios.interceptors.request.use(
  config => {
    return config;
  },
  error => {
    return Promise.reject(err);
  }
);

//http response 拦截器
axios.interceptors.response.use(
  response => {
    return response;
  },
  error => {
    if(error.response.status == 404){
      Message.error("404")
    }
    return Promise.reject(error.response)
  }
);
